function opera(id){
    confirm("你确定商家已付款？",function () {
        debugger;
        //审核通过
        var param={
            "id":id
        }
        var url = '/manage/completeCharge';
        $.ajax({
            type: "POST",
            url: baseURL + url,
            dataType: "json",
            async: true,
            contentType:"application/json",
            data:JSON.stringify(param),
            success: function(r){
                if (r.code===0) {
                    alert("操作成功！",function () {
                        window.location.reload();
                    });
                }else{
                    alert(r.info);
                }
            }
        });
    })
}
$(function () {
    $("#jqGrid").jqGrid({
        url: baseURL + '/manage/chargeAccountList',
        datatype: "json",
        colModel: [         
        { label: 'ID', name: 'id', width: 10, key: true },
        { label: '金额', name: 'sum', width: 30, key: true },
        { label: '用户名', name: 'username', width: 30, key: true },
        { label: '状态', name: 'status', width: 30, key: true ,formatter:function(value, options, row){
            if(value =='1'){
                return '已审核'
            }else{
                return '待审核'
            }
            }},

        { label: '操作',name: 'status', width: 30 ,formatter: function(value, options, row){
            if(row.status !=0){
                return '已处理';
            }else{
                return '<button type="button" class="btn btn-warning " onclick="opera('+row.id+')">审核通过</button>';
            }
        }},
        ],
        viewrecords: true,
        height: 555,
        rowNum: 10,
        rowList : [10,30,50],
        rownumbers: true, 
        rownumWidth: 25, 
        autowidth:true,
        multiselect: true,
        pager: "#jqGridPager",
        jsonReader : {
            root: "data.dataList",
            page: "data.pageNo",
            records: "data.totalNum",
            total: "data.total"
        },
        prmNames : {
            page:"pageNo", 
            rows:"pageSize", 
            order: "order"
        },
        gridComplete:function(){
            //隐藏grid底部滚动条
            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); 
        }
    });
});
var vm = new Vue({
    el:'#rrapp',
    data:{
        q:{
            key: null
        },
        showList: true,
        title: null
    },
    methods: {
        reload: function () {
            vm.showList = true;
            var page = $("#jqGrid").jqGrid('getGridParam','page');
            $("#jqGrid").jqGrid('setGridParam',{ 
                postData:{'key': vm.q.key},
                page:page
            }).trigger("reloadGrid");
        }
    }
});